package com.eastfair.venueservice.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.venueservice.enumeration.ViolationRecordViolationSourceEnum;
import com.eastfair.venueservice.enumeration.ViolationRecordCertificateViolationTypeEnum;
import com.eastfair.venueservice.enumeration.ViolationRecordViolationStatusEnum;
import com.eastfair.venueservice.enumeration.ViolationRecordViolationTypeEnum;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 违规处罚记录
 * </p>
 *
 * @author dqq
 * @since 2023-03-15
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("vsm_violation_record")
@ApiModel(value = "ViolationRecord", description = "违规处罚记录")
@AllArgsConstructor
public class ViolationRecord extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用（确认状态）：1是 已确认；0否 未确认
     */
    @ApiModelProperty(value = "是否启用（确认状态）：1是 已确认；0否 未确认")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用（确认状态）：1是 已确认；0否 未确认")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 违规管理编码
     */
    @ApiModelProperty(value = "违规管理编码")
    @Size(max = 255, message = "违规管理编码长度不能超过255")
    @TableField(value = "violation_code", condition = LIKE)
    @Excel(name = "违规管理编码")
    private String violationCode;

    /**
     * 处罚状态 #{HAS_EFFECT:已生效;HAS_DEDUCT:已扣除;CANCEL:已撤销}
     */
    @ApiModelProperty(value = "处罚状态 #{HAS_EFFECT:已生效;HAS_DEDUCT:已扣除;CANCEL:已撤销}")
    @TableField(value = "violation_status")
    @Excel(name = "处罚状态 #{HAS_EFFECT:已生效;HAS_DEDUCT:已扣除;CANCEL:已撤销}", replace = {"已生效_HAS_EFFECT", "已扣除_HAS_DEDUCT", "已撤销_CANCEL",  "_null"})
    private ViolationRecordViolationStatusEnum violationStatus;

    /**
     * 处罚类型 #{REFORM:整改;DEDUCT_MONEY:罚款}
     */
    @ApiModelProperty(value = "处罚类型 #{REFORM:整改;DEDUCT_MONEY:罚款}")
    @TableField(value = "violation_type")
    @Excel(name = "处罚类型 #{REFORM:整改;DEDUCT_MONEY:罚款}", replace = {"整改_REFORM", "罚款_DEDUCT_MONEY",  "_null"})
    private ViolationRecordViolationTypeEnum violationType;

    /**
     * 布撤展管理记录id
     */
    @ApiModelProperty(value = "布撤展管理记录id")
    @TableField(value = "arrange_manage_id")
    @Excel(name = "布撤展管理记录id")
    private Long arrangeManageId;

    /**
     * 展会id
     */
    @ApiModelProperty(value = "展会id")
    @TableField(value = "exhibition_manage_id")
    @Excel(name = "展会id")
    private Long exhibitionManageId;

    /**
     * 展馆编码
     */
    @ApiModelProperty(value = "展馆编码")
    @Size(max = 100, message = "展馆编码长度不能超过100")
    @TableField(value = "space_code", condition = LIKE)
    @Excel(name = "展馆编码")
    private String spaceCode;

    /**
     * 展馆号
     */
    @ApiModelProperty(value = "展馆号")
    @Size(max = 100, message = "展馆号长度不能超过100")
    @TableField(value = "space_name", condition = LIKE)
    @Excel(name = "展馆号")
    private String spaceName;

    /**
     * 展位编码
     */
    @ApiModelProperty(value = "展位编码")
    @Size(max = 100, message = "展位编码长度不能超过100")
    @TableField(value = "site_code", condition = LIKE)
    @Excel(name = "展位编码")
    private String siteCode;

    /**
     * 展位号
     */
    @ApiModelProperty(value = "展位号")
    @Size(max = 100, message = "展位号长度不能超过100")
    @TableField(value = "site_name", condition = LIKE)
    @Excel(name = "展位号")
    private String siteName;

    /**
     * 展位类型
     */
    @ApiModelProperty(value = "展位类型")
    @Size(max = 64, message = "展位类型长度不能超过64")
    @TableField(value = "site_type", condition = LIKE)
    @Excel(name = "展位类型")
    private String siteType;

    /**
     * 展位面积
     */
    @ApiModelProperty(value = "展位面积")
    @TableField(value = "site_area")
    @Excel(name = "展位面积")
    private BigDecimal siteArea;

    /**
     * 展商ID
     */
    @ApiModelProperty(value = "展商ID")
    @TableField(value = "exhibitor_id")
    @Excel(name = "展商ID")
    private Long exhibitorId;

    /**
     * 展商名称
     */
    @ApiModelProperty(value = "展商名称")
    @Size(max = 100, message = "展商名称长度不能超过100")
    @TableField(value = "exhibitor_name", condition = LIKE)
    @Excel(name = "展商名称")
    private String exhibitorName;

    /**
     * 违规项目ID
     */
    @ApiModelProperty(value = "违规项目ID")
    @TableField(value = "violation_project_id")
    @Excel(name = "违规项目ID")
    private Long violationProjectId;

    /**
     * 违规项目
     */
    @ApiModelProperty(value = "违规项目")
    @Size(max = 100, message = "违规项目长度不能超过100")
    @TableField(value = "violation_project", condition = LIKE)
    @Excel(name = "违规项目")
    private String violationProject;

    /**
     * 扣除分值
     */
    @ApiModelProperty(value = "扣除分值")
    @TableField(value = "score")
    @Excel(name = "扣除分值")
    private Integer score;

    /**
     * 被监督者id
     */
    @ApiModelProperty(value = "被监督者id")
    @TableField(value = "supervised_id")
    @Excel(name = "被监督者id")
    private Long supervisedId;

    /**
     * 被监督者名称(主运,主场，搭建商)
     */
    @ApiModelProperty(value = "被监督者名称(主运,主场，搭建商)")
    @Size(max = 100, message = "被监督者名称(主运,主场，搭建商)长度不能超过100")
    @TableField(value = "supervised_name", condition = LIKE)
    @Excel(name = "被监督者名称(主运,主场，搭建商)")
    private String supervisedName;

    /**
     * 被监督者类型(主场，主运，搭建商 )
     */
    @ApiModelProperty(value = "被监督者类型(主场，主运，搭建商 )")
    @Size(max = 255, message = "被监督者类型(主场，主运，搭建商 )长度不能超过255")
    @TableField(value = "supervised_type", condition = LIKE)
    @Excel(name = "被监督者类型(主场，主运，搭建商 )")
    private String supervisedType;

    /**
     * 被监督企业统一社会信用代码
     */
    @ApiModelProperty(value = "被监督企业统一社会信用代码")
    @Size(max = 20, message = "被监督企业统一社会信用代码长度不能超过20")
    @TableField(value = "supervised_uscc", condition = LIKE)
    @Excel(name = "被监督企业统一社会信用代码")
    private String supervisedUscc;

    /**
     * 被监督企业法人姓名
     */
    @ApiModelProperty(value = "被监督企业法人姓名")
    @Size(max = 64, message = "被监督企业法人姓名长度不能超过64")
    @TableField(value = "supervised_legal_name", condition = LIKE)
    @Excel(name = "被监督企业法人姓名")
    private String supervisedLegalName;

    /**
     * 搭建商施工负责人
     */
    @ApiModelProperty(value = "搭建商施工负责人")
    @Size(max = 64, message = "搭建商施工负责人长度不能超过64")
    @TableField(value = "construction_principal", condition = LIKE)
    @Excel(name = "搭建商施工负责人")
    private String constructionPrincipal;

    /**
     * 搭建商施工负责人联系方式
     */
    @ApiModelProperty(value = "搭建商施工负责人联系方式")
    @Size(max = 64, message = "搭建商施工负责人联系方式长度不能超过64")
    @TableField(value = "principal_phone", condition = LIKE)
    @Excel(name = "搭建商施工负责人联系方式")
    private String principalPhone;

    /**
     * 监督者id(主场，场馆)
     */
    @ApiModelProperty(value = "监督者id(主场，场馆)")
    @TableField(value = "supervisor_id")
    @Excel(name = "监督者id(主场，场馆)")
    private Long supervisorId;

    /**
     * 监督企业名称
     */
    @ApiModelProperty(value = "监督企业名称")
    @Size(max = 200, message = "监督企业名称长度不能超过200")
    @TableField(value = "supervisor_name", condition = LIKE)
    @Excel(name = "监督企业名称")
    private String supervisorName;

    /**
     * 监督者类型(主场，场馆)
     */
    @ApiModelProperty(value = "监督者类型(主场，场馆)")
    @Size(max = 255, message = "监督者类型(主场，场馆)长度不能超过255")
    @TableField(value = "supervisor_type", condition = LIKE)
    @Excel(name = "监督者类型(主场，场馆)")
    private String supervisorType;

    /**
     * 监督人ID
     */
    @ApiModelProperty(value = "监督人ID")
    @TableField(value = "supervisor_user_id")
    @Excel(name = "监督人ID")
    private Long supervisorUserId;

    /**
     * 监督人姓名
     */
    @ApiModelProperty(value = "监督人姓名")
    @Size(max = 100, message = "监督人姓名长度不能超过100")
    @TableField(value = "supervisor_user_name", condition = LIKE)
    @Excel(name = "监督人姓名")
    private String supervisorUserName;

    /**
     * 证件ID
     */
    @ApiModelProperty(value = "证件ID")
    @TableField(value = "certificate_id")
    @Excel(name = "证件ID")
    private Long certificateId;

    /**
     * 证件违规类型 #{PERSON:人证;CAR:车证;NOT_CERTIFICATE:非证件}
     */
    @ApiModelProperty(value = "证件违规类型 #{PERSON:人证;CAR:车证;NOT_CERTIFICATE:非证件}")
    @TableField(value = "certificate_violation_type")
    @Excel(name = "证件违规类型 #{PERSON:人证;CAR:车证;NOT_CERTIFICATE:非证件}", replace = {"人证_PERSON", "车证_CAR", "非证件_NOT_CERTIFICATE",  "_null"})
    private ViolationRecordCertificateViolationTypeEnum certificateViolationType;

    /**
     * 处罚原因
     */
    @ApiModelProperty(value = "处罚原因")
    @Size(max = 500, message = "处罚原因长度不能超过500")
    @TableField(value = "punish_reason", condition = LIKE)
    @Excel(name = "处罚原因")
    private String punishReason;

    /**
     * 处罚依据
     */
    @ApiModelProperty(value = "处罚依据")
    @Size(max = 500, message = "处罚依据长度不能超过500")
    @TableField(value = "punish_basis", condition = LIKE)
    @Excel(name = "处罚依据")
    private String punishBasis;

    /**
     * 处罚结果
     */
    @ApiModelProperty(value = "处罚结果")
    @Size(max = 500, message = "处罚结果长度不能超过500")
    @TableField(value = "punish_result", condition = LIKE)
    @Excel(name = "处罚结果")
    private String punishResult;

    /**
     * 应处罚金额
     */
    @ApiModelProperty(value = "应处罚金额")
    @TableField(value = "should_punish_amount")
    @Excel(name = "应处罚金额")
    private BigDecimal shouldPunishAmount;

    /**
     * 实际处罚扣款
     */
    @ApiModelProperty(value = "实际处罚扣款")
    @TableField(value = "actual_punish_amount")
    @Excel(name = "实际处罚扣款")
    private BigDecimal actualPunishAmount;

    /**
     * 罚款扣除时间
     */
    @ApiModelProperty(value = "罚款扣除时间")
    @TableField(value = "punish_amount_time")
    @Excel(name = "罚款扣除时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime punishAmountTime;

    /**
     * 违规来源 #{HOME_CHECK:主场巡检;VENUE_CHECK:场馆巡检}
     */
    @ApiModelProperty(value = "违规来源 #{HOME_CHECK:主场巡检;VENUE_CHECK:场馆巡检}")
    @TableField(value = "violation_source")
    @Excel(name = "违规来源 #{HOME_CHECK:主场巡检;VENUE_CHECK:场馆巡检}", replace = {"主场巡检_HOME_CHECK", "场馆巡检_VENUE_CHECK",  "_null"})
    private ViolationRecordViolationSourceEnum violationSource;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Size(max = 1000, message = "备注长度不能超过1000")
    @TableField(value = "remark", condition = LIKE)
    @Excel(name = "备注")
    private String remark;


    @Builder
    public ViolationRecord(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId, 
                    String violationCode, ViolationRecordViolationStatusEnum violationStatus, ViolationRecordViolationTypeEnum violationType, Long arrangeManageId, Long exhibitionManageId, String spaceCode, 
                    String spaceName, String siteCode, String siteName, String siteType, BigDecimal siteArea, Long exhibitorId, 
                    String exhibitorName, Long violationProjectId, String violationProject, Integer score, Long supervisedId, String supervisedName, 
                    String supervisedType, String supervisedUscc, String supervisedLegalName, String constructionPrincipal, String principalPhone, Long supervisorId, 
                    String supervisorName, String supervisorType, Long supervisorUserId, String supervisorUserName, Long certificateId, ViolationRecordCertificateViolationTypeEnum certificateViolationType, 
                    String punishReason, String punishBasis, String punishResult, BigDecimal shouldPunishAmount, BigDecimal actualPunishAmount, LocalDateTime punishAmountTime, 
                    ViolationRecordViolationSourceEnum violationSource, String remark) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.violationCode = violationCode;
        this.violationStatus = violationStatus;
        this.violationType = violationType;
        this.arrangeManageId = arrangeManageId;
        this.exhibitionManageId = exhibitionManageId;
        this.spaceCode = spaceCode;
        this.spaceName = spaceName;
        this.siteCode = siteCode;
        this.siteName = siteName;
        this.siteType = siteType;
        this.siteArea = siteArea;
        this.exhibitorId = exhibitorId;
        this.exhibitorName = exhibitorName;
        this.violationProjectId = violationProjectId;
        this.violationProject = violationProject;
        this.score = score;
        this.supervisedId = supervisedId;
        this.supervisedName = supervisedName;
        this.supervisedType = supervisedType;
        this.supervisedUscc = supervisedUscc;
        this.supervisedLegalName = supervisedLegalName;
        this.constructionPrincipal = constructionPrincipal;
        this.principalPhone = principalPhone;
        this.supervisorId = supervisorId;
        this.supervisorName = supervisorName;
        this.supervisorType = supervisorType;
        this.supervisorUserId = supervisorUserId;
        this.supervisorUserName = supervisorUserName;
        this.certificateId = certificateId;
        this.certificateViolationType = certificateViolationType;
        this.punishReason = punishReason;
        this.punishBasis = punishBasis;
        this.punishResult = punishResult;
        this.shouldPunishAmount = shouldPunishAmount;
        this.actualPunishAmount = actualPunishAmount;
        this.punishAmountTime = punishAmountTime;
        this.violationSource = violationSource;
        this.remark = remark;
    }

}
